Change in openvpn[master]: msvc: fix struct initialization for v19 compilers
A message that is not in the archive (sent off-list or not yet received): gerrit.1762865473000.I13e34119303e056fdb51ff9925f4944171c824f2@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1366?usp=email
to review the following change.
Change subject: msvc: fix struct initialization for v19 compilers
......................................................................
msvc: fix struct initialization for v19 compilers
Newer version of MSVC do not show the error anymore, but I do get, e.g.:
test_crypto.c(538,23): error C2059: syntax error: '}'
with version 19.38.33133 installed on a test system.
---
M src/openvpn/ssl_verify_mbedtls.c
M tests/unit_tests/openvpn/test_crypto.c
M tests/unit_tests/openvpn/test_pkcs11.c
3 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/66/1366/1
src/openvpn/ssl_verify_mbedtls.c +1 -1
@@ -230,7 +230,7 @@* headers and footer */ struct buffer pem =alloc_buf_gc (cert->raw.len *3 +100 , &gc); -struct buffer der = {}; +struct buffer der = {0 };buf_set_read (&der, cert->raw.p, cert->raw.len);if (!crypto_pem_encode ("CERTIFICATE" , &pem, &der, &gc))
tests/unit_tests/openvpn/test_crypto.c +1 -1
@@ -535,7 +535,7 @@0x1d ,0x6f ,0x64 ,0x8b ,0xdf ,0x96 ,0x59 ,0x67 ,0x76 ,0xaf ,0xdb , 0x63, 0x77, 0xac, 0x43, 0x4c, 0x1c, 0x29, 0x3c, 0xcb, 0x04 }; -uint8_t info[] = {}; +uint8_t info[] = {0 };int L =42 ; uint8_t okm[42] = { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, 0x71, 0x5f, 0x80,
tests/unit_tests/openvpn/test_pkcs11.c +1 -1
@@ -411,7 +411,7 @@ test_tls_ctx_use_pkcs11(void **state) { (void )state; -struct tls_root_ctx tls_ctx = {}; +struct tls_root_ctx tls_ctx = {0 };uint8_t sha1[HASHSIZE ];for (struct test_cert *c = certs; c->cert; c++) {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1366?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I13e34119303e056fdb51ff9925f4944171c824f2
Gerrit-Change-Number: 1366
Gerrit-PatchSet: 1
Gerrit-Owner: d12fk <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Attention is currently required from: d12fk, plaisthos.
flichtenheld has posted comments on this change by d12fk. ( http://gerrit.openvpn.net/c/openvpn/+/1366?usp=email )
Change subject: msvc: fix struct initialization for v19 compilers
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1366?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I13e34119303e056fdb51ff9925f4944171c824f2
Gerrit-Change-Number: 1366
Gerrit-PatchSet: 1
Gerrit-Owner: d12fk <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: d12fk <[email protected]...>
Gerrit-Comment-Date: Tue, 11 Nov 2025 16:48:05 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
PATCH 1/1 msvc: fix struct initialization for v19 compilers
In reply to a message not in the archiveFrom: Heiko Hund <[email protected]...>
Newer version of MSVC do not show the error anymore, but I do get, e.g.:
test_crypto.c(538,23): error C2059: syntax error: '}'
with version 19.38.33133 installed on a test system.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1366
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1366
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>
src/openvpn/ssl_verify_mbedtls.c +1 -1
@@ -230,7 +230,7 @@* headers and footer */ struct buffer pem =alloc_buf_gc (cert->raw.len *3 +100 , &gc); -struct buffer der = {}; +struct buffer der = {0 };buf_set_read (&der, cert->raw.p, cert->raw.len);if (!crypto_pem_encode ("CERTIFICATE" , &pem, &der, &gc))
tests/unit_tests/openvpn/test_crypto.c +1 -1
@@ -535,7 +535,7 @@0x1d ,0x6f ,0x64 ,0x8b ,0xdf ,0x96 ,0x59 ,0x67 ,0x76 ,0xaf ,0xdb , 0x63, 0x77, 0xac, 0x43, 0x4c, 0x1c, 0x29, 0x3c, 0xcb, 0x04 }; -uint8_t info[] = {}; +uint8_t info[] = {0 };int L =42 ; uint8_t okm[42] = { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, 0x71, 0x5f, 0x80,
tests/unit_tests/openvpn/test_pkcs11.c +1 -1
@@ -411,7 +411,7 @@ test_tls_ctx_use_pkcs11(void **state) { (void )state; -struct tls_root_ctx tls_ctx = {}; +struct tls_root_ctx tls_ctx = {0 };uint8_t sha1[HASHSIZE ];for (struct test_cert *c = certs; c->cert; c++) {
[Openvpn-devel] [PATCH applied] Re: msvc: fix struct initialization for v19 compilers
This makes sense - it matches how we do struct initialization elsewhere (in networking_sitnl, a few '= {}' remain, but everything else clears with CLEAR() or with '= { 0 }').
For a sanity check, compiled on ubuntu2404/mingw.
Your patch has been applied to the master branch.
commit 5888adc6fa86ae6ec718c76f733733c8b9fbd38b
Author: Heiko Hund Date: Tue Nov 11 18:24:57 2025 +0100
msvc: fix struct initialization for v19 compilers
Signed-off-by: Heiko Hund <[email protected]...>
Acked-by: Frank Lichtenheld <[email protected]...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1366
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34327.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#2) to the change originally created by d12fk. ( http://gerrit.openvpn.net/c/openvpn/+/1366?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld
Change subject: msvc: fix struct initialization for v19 compilers
......................................................................
msvc: fix struct initialization for v19 compilers
Newer version of MSVC do not show the error anymore, but I do get, e.g.:
test_crypto.c(538,23): error C2059: syntax error: '}'
with version 19.38.33133 installed on a test system.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1366
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34327.html
---
M src/openvpn/ssl_verify_mbedtls.c
M tests/unit_tests/openvpn/test_crypto.c
M tests/unit_tests/openvpn/test_pkcs11.c
3 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/66/1366/2
src/openvpn/ssl_verify_mbedtls.c +1 -1
@@ -230,7 +230,7 @@* headers and footer */ struct buffer pem =alloc_buf_gc (cert->raw.len *3 +100 , &gc); -struct buffer der = {}; +struct buffer der = {0 };buf_set_read (&der, cert->raw.p, cert->raw.len);if (!crypto_pem_encode ("CERTIFICATE" , &pem, &der, &gc))
tests/unit_tests/openvpn/test_crypto.c +1 -1
@@ -535,7 +535,7 @@0x1d ,0x6f ,0x64 ,0x8b ,0xdf ,0x96 ,0x59 ,0x67 ,0x76 ,0xaf ,0xdb , 0x63, 0x77, 0xac, 0x43, 0x4c, 0x1c, 0x29, 0x3c, 0xcb, 0x04 }; -uint8_t info[] = {}; +uint8_t info[] = {0 };int L =42 ; uint8_t okm[42] = { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, 0x71, 0x5f, 0x80,
tests/unit_tests/openvpn/test_pkcs11.c +1 -1
@@ -411,7 +411,7 @@ test_tls_ctx_use_pkcs11(void **state) { (void )state; -struct tls_root_ctx tls_ctx = {}; +struct tls_root_ctx tls_ctx = {0 };uint8_t sha1[HASHSIZE ];for (struct test_cert *c = certs; c->cert; c++) {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1366?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I13e34119303e056fdb51ff9925f4944171c824f2
Gerrit-Change-Number: 1366
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1366?usp=email )
Change subject: msvc: fix struct initialization for v19 compilers
......................................................................
msvc: fix struct initialization for v19 compilers
Newer version of MSVC do not show the error anymore, but I do get, e.g.:
test_crypto.c(538,23): error C2059: syntax error: '}'
with version 19.38.33133 installed on a test system.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1366
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34327.html
---
M src/openvpn/ssl_verify_mbedtls.c
M tests/unit_tests/openvpn/test_crypto.c
M tests/unit_tests/openvpn/test_pkcs11.c
3 files changed, 3 insertions(+), 3 deletions(-)
src/openvpn/ssl_verify_mbedtls.c +1 -1
@@ -230,7 +230,7 @@* headers and footer */ struct buffer pem =alloc_buf_gc (cert->raw.len *3 +100 , &gc); -struct buffer der = {}; +struct buffer der = {0 };buf_set_read (&der, cert->raw.p, cert->raw.len);if (!crypto_pem_encode ("CERTIFICATE" , &pem, &der, &gc))
tests/unit_tests/openvpn/test_crypto.c +1 -1
@@ -535,7 +535,7 @@0x1d ,0x6f ,0x64 ,0x8b ,0xdf ,0x96 ,0x59 ,0x67 ,0x76 ,0xaf ,0xdb , 0x63, 0x77, 0xac, 0x43, 0x4c, 0x1c, 0x29, 0x3c, 0xcb, 0x04 }; -uint8_t info[] = {}; +uint8_t info[] = {0 };int L =42 ; uint8_t okm[42] = { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, 0x71, 0x5f, 0x80,
tests/unit_tests/openvpn/test_pkcs11.c +1 -1
@@ -411,7 +411,7 @@ test_tls_ctx_use_pkcs11(void **state) { (void )state; -struct tls_root_ctx tls_ctx = {}; +struct tls_root_ctx tls_ctx = {0 };uint8_t sha1[HASHSIZE ];for (struct test_cert *c = certs; c->cert; c++) {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1366?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I13e34119303e056fdb51ff9925f4944171c824f2
Gerrit-Change-Number: 1366
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>